package com.isoft.farm.controller;

import com.isoft.farm.common.JsonResult;
import com.isoft.farm.common.PageObject;
import com.isoft.farm.entity.SysCar;
import com.isoft.farm.service.SysCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("car")
public class SysCarController {
    @Autowired
    SysCarService sysCarService;


    @RequestMapping("doFindPageObjects")
    @ResponseBody
    public JsonResult doFindPageObjects(String CBH, Integer pageCurrent){

        PageObject<SysCar> pageObjects=sysCarService.findPageObjects(CBH,pageCurrent);
        return new JsonResult(pageObjects);
    }
    @RequestMapping("/doFindObjectById")
    @ResponseBody
    public JsonResult doFindObjectById(Integer id){
        return new JsonResult(sysCarService.findObjectById(id));
    }
}
